/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cloudminga.database;

/**The class TableModel is created for set the value of data into TableModel
 *
 * @author jyoti
 */
import javax.swing.table.AbstractTableModel;
public class TableModel extends  AbstractTableModel {

        int column=0;
        int row=0;
        Object object[][]=null;

        public TableModel(int row,int column)
        {
            this.row=row;
            this.column=column;
            object=new Object[row][column];
        }

    @Override
        public int getRowCount() {
        return row;
    }

    @Override
    public int getColumnCount() {
        return column;
    }

     public void  setRowCount(int row) {
        this.row=row;
    }

    public void getColumnCount( int column) {
        this.column=column;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        Object ob=null;
        if(row>0&&column>0)
            ob=object[rowIndex][columnIndex];
        return ob;

    }

    public void setValueAt(int rowIndex, int columnIndex,Object object) {

            this.object[rowIndex][columnIndex]=object;

    }
}